<template>
  <div class="con-layout jobDetail noPadBottom">
    <my-bread title="职位详情" :goback="true" ref="head"></my-bread>
    <div class="content" v-if="zpxx.dwdjid">
      <div class="job-item">
        <div class="job-msg">
          <p>{{zpxx.gwmc}}</p>
          <span>{{zpxx.xc_xs}}</span>
        </div>
        <p class="job-con">招聘人数 {{zpxx.zrs}}人 | 用工形式 {{zpxx.ygxs}}</p>
        <p class="job-con">发布时间 {{zpxx.fbsj}}</p>
      </div>
      <div class="job-item">
        <h1>工作地区</h1>
        <p class="job-address">{{zpxx.gzdq}}</p>
      </div>
      <div class="job-item">
        <h1>职位描述</h1>
        <div class="job-des">
          <div class="job-des-item">
            <span>岗位职责:</span>
            <p v-html="$options.filters.lineBreak(zpxx.gwzz)"></p>
          </div>
          <div class="job-des-item">
            <span>岗位要求:</span>
            <p v-html="$options.filters.lineBreak(zpxx.gwyq)"></p>
          </div>
          <div class="job-des-item">
            <span>福利待遇:</span>
            <p>{{zpxx.fldy}}</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      zpgwid: this.$route.query.zpgwid,
      zpxx: {}
    };
  },
  filters:{
    lineBreak(val){
      return val.replace(/\|BKSX\|/g,()=>{
        return '<br>'
      })
    }
  },
  created() {
    this.init();
  },
  methods: {
    init() {
      this.$loading = true;
      this.$http({
        url: "/dwgl/zpgwxxCx",
        method: "get",
        params: {
          zpgwid: this.zpgwid
        }
      })
        .then(res => {
          var _res = res.returnData;
          if (+_res.executeResult == 1) {
            this.zpxx = _res.zpxx;
          } else {
            this.$alert({
              type: "warning",
              message: _res.message
            });
            return false;
          }
        })
        .finally(() => {
          this.$loading = false;
        });
    }
  }
};
</script>

<style lang="scss" scoped>
@import "~common/scss/var.scss";
.jobDetail {
  .job-item {
    background-color: #ffffff;
    padding: 33px 32px;
    box-sizing: border-box;
    margin-bottom: 21px;
    h1 {
      font-weight: normal;
      color: #333333;
      font-size: 32px;
      width: 100%;
      padding-left: 21px;
      padding-bottom: 21px;
      border-bottom: 1px solid #dbdbdb;
      box-sizing: border-box;
      position: relative;
      &::before {
        content: "";
        width: 4px;
        height: 30px;
        background-color: #1d66d4;
        position: absolute;
        left: 0;
        top: 2px;
      }
    }
  }
  .job-address {
    margin-top: 10px;
    color: #999;
    font-size: 30px;
    line-height: 50px;
  }
  .job-msg {
    display: flex;
    justify-content: space-between;
    align-items: center;
    p {
      flex: 1;
      font-weight: 400;
      font-size: 34px;
    }
    span {
      width: 200px;
      color: #fb4d64;
      text-align: right;
      font-size: $font-size-base;
    }
  }
  .job-con {
    font-size: 24px;
    color: $color-text-label;
    margin-top: 30px;
  }
  .job-des {
    color: #999999;
    font-size: 30px;
    margin-top: 20px;
    .job-des-item {
      display: flex;
      justify-content: center;
      align-items: baseline;
      line-height: 50px;
      span {
        flex: 0 0 auto;
        margin-right: 20px;
      }
      p {
        flex: 1;
        font-size: 28px;
      }
    }
  }
}
</style>
